<?php
//$path_tema = path_to_theme();
//drupal_add_css($path_tema.'/js/jquery.bxslider/jquery.bxslider.css');
global $base_url;

?>
<footer>
    <div class="footer-newsletter">
        <div class="container">
            <div class="row">
                <div class="col-md-3">
                    <span class="pull-left"><h1>Newsletter</h1></span>
                </div>
                <div class="col-md-3">
                    <span class="pull-left">
                        <p>Cadastre-se e fique por dentro de todas as novidades da QGDI.</p>
                    </span>
                </div>
                <div class="col-md-6">
                    <form class="pull-left" method="post" action="<?php print $base_url; ?>/cadastrar-newsletters">
                        <div class="input-group">
                            <input type="text" name="strNome" id="strNome" class="" placeholder="Nome:">
                            <input type="text" name="strEmail" id="strEmail" class="" placeholder="Email:">
                            <button type="submit" class="btn ir">Ok</button>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>

    <div class="footer-widgets" style="background:#e1e1e1">
        <div class="container">
            <div class="row">
                <?php
                $menu_rodape = menu_tree_all_data('menu-rodape');
                $contador_arr_rodape = 0;
                $classe_menu_rodape = 'nada';

                foreach ($menu_rodape as $item):
                    $arrSubMenu = $item['below'];
                    $nomeMenu = $item['link']['link_title'];

                    if ($contador_arr_rodape === 0) {
                        $classe_menu_rodape = 'col-md-offset-1';
                    } else {
                        $classe_menu_rodape = 'nada';
                    }
                    
                    $contador_arr_rodape++;
                    ?>

                    <div class="col-md-2 <?php print $classe_menu_rodape; ?>">
                        <div class="widget-tab">
                            <h3> <?php print $nomeMenu; ?> </h3>
                            <ul class="list-group">
                            <?php
                            
//                            print '<pre>';
//                            var_dump($arrSubMenu);
//                            die();
                            
                            foreach ($arrSubMenu as $subItem):
                                $nomeSUbMenu = $subItem['link']['link_title'];
                                $link = drupal_get_path_alias($subItem["link"]["link_path"]);
                                
                                if(!strstr($link, "http")){
                                    $link = $base_url ."/". $link;
                                }
                                if ($link == "<front>") {
                                    $link = $base_url . "/";
                                }
                                
                                if (!empty($subItem["link"]["options"]["fragment"])) {
                                    $link .= "#" . $subItem["link"]["options"]["fragment"];
                                }
                            
                            ?>
                                    <li class="item"><a href="<?= $link; ?>"><?php print $nomeSUbMenu; ?></a></li>
                                <?php endforeach; ?>
                            </ul>
                        </div>
                    </div>

                <?php endforeach; ?>

            </div>
        </div>
    </div>

    <div class="address" style="background:#cfcfcf">
        <div class="container">
            <div class="row">
                <div class="col-md-2 col-lg-offset-1">
                    <span class="pull-left">
                        <div class="logo-footer"></div>
                    </span>
                </div>
                <div class="col-md-4">
                    <span class="pull-left">
                        <p>Recife - Rua Antônio Lumack do Monte, nº 128 - 7º andar, Empresarial Center III. CEP: 51.020-350 - Recife PE</p>
                    </span>
                </div>
                <div class="col-md-5">
                    <span class="pull-left">
                        <p>PABX: + 55 (81) 3464-1900 | FAX: + 55 (81) 3464-1935</p>
                        <p>CNPJ: 11.535.028/0001-40</p>
                    </span>
                </div>
            </div>
        </div>
    </div>
</footer>